var __extends =
    (this && this.__extends) ||
    (function () {
      var o = function (t, n) {
        return (o =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (o, t) {
              o.__proto__ = t;
            }) ||
          function (o, t) {
            for (var n in t)
              Object.prototype.hasOwnProperty.call(t, n) && (o[n] = t[n]);
          })(t, n);
      };
      return function (t, n) {
        function i() {
          this.constructor = t;
        }
        if ("function" != typeof n && null !== n)
          throw new TypeError(
            "Class extends value " + String(n) + " is not a constructor or null"
          );
        o(t, n),
          (t.prototype =
            null === n
              ? Object.create(n)
              : ((i.prototype = n.prototype), new i()));
      };
    })(),
  ChangeOccupationDialog = (function (o) {
    function t() {
      var t = o.call(this) || this;
      return (
        t.radio_occp_group.on(Laya.Event.CLICK, t, t.onDidClickOccpGroup),
        t.btn_occp_sure.on(Laya.Event.CLICK, t, t.onDidOccpSureAction),
        WebSocketService.addListener({
          caller: t,
          code: 11010,
          method: t.onLoadChangeOccuptionFn,
        }),
        t
      );
    }
    return (
      __extends(t, o),
      (t.showChangeOccputionDialog = function (o) {
        return (
          null == this.occupationDialog &&
            ((this.occupationDialog = new t()),
            (this.occupationDialog.zOrder = 1e3)),
          this.occupationDialog.popup(),
          (this.occupationDialog.radio_occp_group.selectedIndex = 0),
          (this.occupationDialog.objJson = o),
          this.occupationDialog.initData(),
          this.occupationDialog
        );
      }),
      (t.prototype.initData = function () {
        var o = Utils.dealRole_Type(this.objJson.roleType);
        console.log(Utils.dealRole_Type(this.objJson.roleType)),
          "武士" == o
            ? (this.radio_occp_group.labels = "文人,异师")
            : "文人" == o
            ? (this.radio_occp_group.labels = "武士,异师")
            : "异师" == o && (this.radio_occp_group.labels = "武士,文人");
      }),
      (t.dealRole_Type = function (o) {
        return Utils.transform(o % 10, "roleType");
      }),
      (t.prototype.onDidClickOccpGroup = function () {}),
      (t.prototype.onLoadChangeOccuptionFn = function (o) {
        ToastView.toastView(o.msg),
          Laya.stage.event("AXSuboardinateDetailView", "update_Suboardinate");
      }),
      (t.prototype.onDidOccpSureAction = function () {
        var o = this,
          t = this.radio_occp_group.selection.label,
          n = "1";
        "武士" == t
          ? (n = "1")
          : "文人" == t
          ? (n = "2")
          : "异师" == t && (n = "3"),
          NormalDialog.showNormalDialog(
            "更换职业将清空技能熟练度，确认将职业更换为" + t,
            this,
            function () {
              WebSocketService.send({
                c: 11010,
                d: { type: n, cid: o.objJson.id },
              });
            }
          );
      }),
      t
    );
  })(ui.dialog.ChangeOccupationDialogUI);
